Method and circuit arrangement for determining the direction of an external magnetic field

ABSTRACT

A method for determining the direction of an external magnetic field (B) using a magneto-resistive sensor comprises the following steps: superimposing a fluctuating magnetic field on the external magnetic field (B); creating a first and second signal dependent on the sine and cosine of the angle between the external magnetic field and a reference vector by decoupling or disregarding the respective signal components which are dependent on the fluctuating magnetic field; determination of a third signal which is dependent upon the angle between the external magnetic field and a reference vector on the basis of the first and second signal whereby said third signal has a periodicity of 180°; determination of a logic correction signal (K 5 ) with regard to the signal component which is dependent on the fluctuating magnetic field decoupled from either the first or second signal and which adopts a value for the angle of the external magnetic field in a first angle range, in particular between 0° and 180° and adopts another value in a second angle range, in particular between 180° and 360°; and determination of the actual angle of magnetic field (B) on the basis of a logic correction signal (K 5 ) and the third signal.

BACKGROUND OF THE INVENTION

The present invention relates to a method and a circuit arrangement fordetermining a direction of an exterior magnetic field.

The use of magnetoresistive elements in the context of angle sensors isknown. For instance, on the basis of the AMR (anisotropicmagnetoresistance) effect, angle sensors furnish output signals fromwhich the direction of an externally applied magnetic field can bedetermined. If the angle of the magnetic field relative to the sensor isα, then the sensor produces output signals that are proportional tosin(2α) and cos(2xα). AMR sensors that function in this way furnish anonambiguity range of 180° available, based on the periodicity of thesine and cosine signals. In a further development of such AMR sensors,as disclosed for instance in German Patent Application DE 198 39 446,which had not yet been published by the priority date of the presentapplication, these sensors are embodied with integrated auxiliary coils.

By application of a suitable current to the auxiliary coils, individual,slight additional magnetic fields are generated in the various sensorhalves; these fields are superimposed on the exterior magnetic field tobe measured and change the direction of the resultant field. Byobservation of the change in direction, the nonambiguity range of thesensor can be increased from 180° to 360°.

SUMMARY OF THE INVENTION

The object of the invention is to assure the simplest possibletriggering and evaluation of an angle sensor that has a nonambiguityrange of 360°.

This object is attained by a method for determining the direction of anexterior magnetic field B, using a magnetoresistive sensor, having thefollowing steps:

superimposing a fluctuating magnetic field on the exterior magneticfield B;

generating a first and second signal, dependent on the sine and cosineof the angle of the exterior magnetic field relative to a referencedirection, eliminating or ignoring any signal components dependent onthe fluctuating magnetic field;

ascertaining a third signal, which can be associated with the angle ofthe exterior magnetic field relative to the reference direction, on thebasis of the first and second signal, this third signal having aperiodicity of 180°;

ascertaining a correction logic signal, taking into account the signalcomponent, eliminated from the first and second signal and dependent onthe fluctuating magnetic field, which signal component assumes a firstlevel for an angle of the exterior magnetic field B in a first anglerange, in particular between 0 and 180°, and a second level in a secondangle range, in particular between 180 and 360°; and

ascertaining the actual angle of the magnetic field B on the basis ofthe logic correction signal and of the third signal.

According to the invention, an interference-proof triggering andevaluation method for 360° AMR angle sensors, which for instancefunctions independently of a temperature-dependent amplitude of thesensor signals, is made available. Fixed threshold values are not neededfor performing the method. The method can be achieved economically in anelectronic circuit. Measuring the effect of the current in the auxiliarycoil, by means of which coil the fluctuating magnetic field isgenerated, is done continuously in the background, without interferingwith the measurement of the uncorrected angle (that is, the angle of themagnetic field to be measured). As a result, compared with knownversions that use auxiliary coils, the current in the auxiliary coil canbe kept quite low, and thus thermal effects in the sensor thatconventionally occur can be avoided. Also because of the low coilcurrent, the total power loss is markedly reduced compared withconventional versions.

Advantageous features of the method and of the arrangement according tothe invention are the subject of the dependent claims.

In preferred embodiment of the method of the invention, the first andthe second signal, which can be assigned to the sine and the cosine,respectively, of the exterior magnetic field are additionally taken intoaccount for ascertaining the logic correction signal K5. The first andsecond signal are each delivered to comparators, which by comparison ofthese signals with threshold values generate logic signals. By logicallinkage of the logic signals thus obtained with logic signals obtainedon the basis of the eliminated signal components, the correction logicsignal can be furnished in a way that is computationally uncomplicated.

In a further preferred feature of the method of the invention, forascertaining the logic correction signal, a further digital signal K6 isused, which assumes a first or second level as a function of an anglethat can be associated with the fifth signal. With this provision, twocomparators, which must be furnished if two logic signals on the basisof the first and second signals are furnished, can be dispensed with.

Expediently, the further logic signal assumes a first level for an anglerange from 135 to 180°, and a second level for an angle range from 0 to135°.

The object of the invention is also attained by a circuit arrangementhaving the characteristics of claim 5. This circuit arrangement isrelatively inexpensive to furnish and at little effort and expense makesit possible to create a 360° angle sensor, using an AMR sensor, whichintrinsically has a nonambiguity range of 180°, and a correspondinglogic correction signal.

BRIEF DESCRIPTION OF THE DRAWINGS

Preferred embodiments of the invention will now be described in detailin conjunction with the accompanying drawing. Shown in the drawing are

FIG. 1, a first preferred embodiment of the circuit arrangement of theinvention;

FIG. 2, a second preferred embodiment of the circuit arrangement of theinvention;

FIG. 3, a graph showing cosine-wave and sine-wave signals obtained as afunction of an exterior magnetic field when an AMR sensor is used;

FIG. 4, a graph showing changes in the signals of FIG. 3 in the eventmodulation of an external field by a fluctuating further magnetic field;

FIG. 5, a graph showing digital signals obtained in the context of theembodiment of the method of the invention shown; and

FIG. 6, a graph showing measured magnetic field angles that can beobtained by the method and the circuit arrangement of the invention, asa function of an actual magnetic field angle.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

In FIG. 1, an AMR sensor is indicated by reference numeral 1. The AMRsensor 1 is subjected to a supply voltage VCC. The AMR sensor 1 isembodied with auxiliary coils (not shown); by application of analternating current to these auxiliary coils, fluctuating magneticfields can be generated, which are superimposed on an external fieldthat is to be measured. The direction of the exterior magnetic field Bto be measured is represented by the arrow 2. In the (instantaneous)state shown, the magnetic field B has an angle α relative to a referencedirection. It will be noted that the fluctuating magnetic field is smallcompared to the exterior magnetic field.

The auxiliary coils are supplied via a generator 3 with an alternatingvoltage whose frequency is typically in the kHz range. In the drawing,only the terminals 11, 12 of the auxiliary coil are shown. Thealternating voltage preferably involves a square signal, which isrelatively simple to generate.

The measurement task of the AMR sensor is to determine the direction ofthe magnetic field B, that is, the angle α, unambiguously over a rangefrom 0 to 360°.

The AMR sensor 1, at its outputs C₁, C₂, furnishes a sine-wave signalthat can be associated with the angle α, and at its outputs S₁, S₂, itfurnishes a cosine-wave signal that can be associated with the angle α.These signals are initially amplified in respective differentialamplifiers 4 and 5.

After any offset voltages that may be possible are subtracted insubtractors 6 and 7, signals of the form Acos (2α) and Asin (2α),respectively, are available. Here, A represents thetemperature-dependent amplitude of the signal. Such signals are shownfor illustration purposes in FIG. 3.

The output signals of the differential amplifiers 4, 5 represent firstand second signals. The magnetic total field is composed of the exteriormagnetic field to be measured and the magnetic field generated by theauxiliary coils.

The relatively slight fluctuations in these first and second signalsthat are caused by the fluctuating magnetic field play no role, or canbe ignored, for an angle evaluation that is then performed in an angleevaluation unit 8. This is because, first, the incident fluctuations canbe averaged out in an angle calculation in the unit 8, and second, thatcapacitors, described in detail hereinafter, act as high-pass filterswith regard to the fluctuating component of the first and secondsignals, and the fluctuations in the first and second signals can beeliminated by way of these filters.

The angle evaluation unit 8 initially determines the uncorrected angleα, which is unambiguously determined only in the range from 0 to 180°.This can be done for instance by forming the arc tangent, especially bythe formula:

α=0.5*arctan([A*sin(2*α)]/[A*cos(2*α)]).

The first and second signal are also delivered to two comparators 12,13. Then the logic correction signal Kl of the comparator 12 equals 1,if the third signal (cosine-wave signal) is ≧0. Then the signal K2 (thelogic output signal of the comparator 13) equals 1, if the fourth signal(sine-wave signal) is <0. The signals K1, K2 are then delivered to anAND element 14.

The slight fluctuations in the first and second signal that are causedby the alternating current in the auxiliary coil are eliminated via theaforementioned capacitors 10, 11 and carried to two synchronousdemodulators 16, 17, followed by respective low-pass filters 18, 19. Atthe pace of the generator signal of the generator 3, the synchronousdemodulators periodically change the polarization of the respectiveinput signal. The result is a phase-sensitive rectification of thealternating component. At the outputs of the low-pass filters, thesignals shown in FIG. 4, “change in cosine signal” and “change in sinesignal” can be observed directly.

From these signals, two further comparators 20, 21 form further logicsignals K3 and K4. The signal K3=1 when the sum of the sine changesignal and the cosine change signal is ≧0; the signal K4=1, if thedifference between the sine change signal and the cosine change signalis ≧0.

The logic or digital signals K1-K4 are plotted in FIG. 5, in the firstfour lines, as a function of a respective angle of the exterior magneticfield.

From the logic signals K1-K4, by means of the aforementioned AND element14, an OR element 24, and two NAND elements 25, 26, a further logicsignal K5 is formed in the manner shown by logical combination. Thesignal K5 should=0 in the range from 0 to 180° and should=1 in the rangefrom 180 to 360°. The signal K5 is shown in FIG. 5, bottom line.

The logic signal K5, together with a fifth signal obtained in the angleevaluation unit 8, is delivered to an evaluation and adder unit 30. Inthe case where a assumes the value of 1, a correction value of 180° isadded in this element 30 to the output signal of the angle evaluationunit 8, so that on the basis of an uncorrected angular value, which hasa periodicity of 180°, a corrected angular value with a periodicity of360° can be furnished. This becomes clear from FIG. 6, in which theuncorrected angle is shown at the top and the corrected measured angleis shown at the bottom, in both cases as a function of an actual angleof the exterior magnetic field.

It will be noted that in FIG. 5 with respect to the logic signals K3,K4, angle ranges have been ascertained that are characterized by afrequent change from 0 to 1. In these ranges, an unambiguous statementabout the sign of the corresponding input signal cannot be made, sincethe input signal in that case is very small, and offset voltages of thecomparators or noise signals can under some circumstances then lead toadulterated information.

The logic embodied according to FIG. 1 for calculating the correctionvalue K5 takes account of this fact. The signals K3 and K4 aredetermined only in the angle ranges for ascertaining K5 in which regionsthey can each be determined “with certainty”.

FIG. 2 shows a modification of the circuit of FIG. 1. Identical orequivalent components are identified by the same reference numerals asin FIG. 1.

The embodiment in FIG. 2 differs from that of FIG. 1 in that a logicsignal K6 is fed directly from the angle evaluation unit 8 to an ORelement 44. Here, K6=1, if the measured uncorrected angle α is in therange from 135 to <180°. By this provision, in comparison to the circuitof FIG. 1, it is possible to dispense with two comparators and one ANDelement and nevertheless to make a suitable logic signal K5 available.In this connection it should be pointed out in particular that as aresult, the influence of the offset voltages of the two omittedcomparators is thus eliminated as well.

What is claimed is:
 1. A method for determining the direction of anexterior magnetic field B, using a magnetroresistive sensor, having thefollowing steps: superimposing a fluctuating magnetic field on theexterior magnetic field B; generating a first and second signal,dependent on the sine and cosine of the angle of the exterior magneticfield relative to a reference direction; eliminating or ignoring anysignal component dependent on the fluctuating magnetic field;ascertaining a third signal, which can be associated with an angle ofthe exterior magnetic field relative to the reference direction, on thebasis of the first and second signal, this third signal having aperiodicity of 180°; ascertaining a correction logic signal K5, takinginto account the signal component, eliminated from the first and secondsignal and dependent on the fluctuating magnetic field, which signalcomponent assumes a first level for an angle of the exterior magneticfield B in a first angle range, in particular between 0 and 180°, and asecond level in a second angle range, in particular between 180° and360°; and ascertaining the actual angle of the magnetic field B on thebasis of the logic correction signal K5 and of the third signal.
 2. Themethod of claim 1, characterized in that for ascertaining the logiccorrection signal K5, the first and the second signal are taken intoaccount in addition.
 3. The method of claim 1, characterized in that forascertaining the logic correction signal, a further digital signal K6 isused, which assumes a first or second level as a function of an anglethat can be associated with a fifth signal.
 4. The method of claim 3,characterized in that the further logic signal K6 assumes a first levelfor an angle range from 135 to 180°, and a second level for an anglerange from 0 to 135°.
 5. A circuit arrangement for determining thedirection of an exterior magnetic field B, using a magnetoresistivesensor, having the means (3) for superimposing a fluctuating magneticfield on the exterior magnetic field B; means (1, 4, 5) for generating afirst and second signal, dependent on the sine and cosine of an angle ofthe exterior magnetic field relative to a reference direction;eliminating or ignoring any signal components dependent on thefluctuating magnetic field; means (8) for ascertaining a third signal,which can be associated with the angle of the exterior magnetic fieldrelative to the reference direction, on the basis of the first andsecond signal, this third signal having a periodicity of 180°; means(10, 11, 16, 17, 18, 19, 20, 21, 12, 13, 14, 24, 25, 26) forascertaining a correction logical signal K5, taking into account thesignal component, eliminated from the first and second signal anddependent on the fluctuating magnetic field, which signal componentassumes a first level for an angle of the exterior magnetic field B in afirst angle range, in particular between 0 and 180°, and a second levelin a second angle range, in particular between 180 and 360°; and means(30) for ascertaining the actual angle of the magnetic field B on thebasis of the logic correction signal K5 and of the third signal.
 6. Thecircuit arrangement of claim 5, characterized by means (8) forgenerating a further logic signal K6, which assumes a first or a secondlevel as a function of an angle that can be associated with the thirdsignal.